import  Axios from "axios"

export default class Addrelist{
    static addrelist = null

    static getInstance(){
        if(this.addrelist == null){
            this.addrelist = new Addrelist()
        }
        return this.addrelist
    }
    //查询所有通讯录
    list(adder){
        return Axios.get(`http://localhost/admaddress/`, {params: adder});
    }
    //根据id查询通讯录
    listId(id){
        return Axios.get(`http://localhost/admaddress/${id}`);
    }
    save(exp){
        return Axios.post("http://localhost/admaddress/add",exp)
    }
    //修改
    update(exp){
        return Axios.put("http://localhost/admaddress/update",exp)
    }
    //删除
    remove(id){
        return Axios.delete(`http://localhost/admaddress/${id}`)
    }
}